package cn.upfinder.allvideo.Presenter;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import java.util.ArrayList;

import cn.upfinder.allvideo.Activity.VideoDetailActivity;
import cn.upfinder.allvideo.Contract.VideoDetailContact;
import cn.upfinder.datalibrary.Api.ApiManage;
import cn.upfinder.datalibrary.Bean.VideoEntity;
import cn.upfinder.datalibrary.Config.VideoType;
import rx.Observer;


/**
 * Created by upfinder on 2016/11/23 0023.
 */

public class VideoDetailPresenter implements VideoDetailContact.Presenter {
    private static final String TAG = VideoDetailPresenter.class.getSimpleName();

    private Context context;
    private VideoDetailContact.View mvpView;

    public VideoDetailPresenter(Context context, VideoDetailContact.View mvpView) {
        this.context = context;
        this.mvpView = mvpView;

    }


    @Override
    public void start() {

    }

    @Override
    public void parseIntent(Intent intent) {

        Bundle bundle = intent.getBundleExtra(VideoDetailActivity.BUNDLE_KEY);
        VideoEntity videoBean = (VideoEntity) bundle.getSerializable(VideoDetailActivity.BUNDLE_KEY);
        mvpView.showDetailData(videoBean);

    }

    @Override
    public void parseParts(VideoEntity videoEntity, String htmlStr) {

        int videoType = videoEntity.getVideotype();
        switch (videoType) {
            case VideoType.YOUKU_TV:
                break;
            case VideoType.YOUKU_PLAY:
                break;
            case VideoType.YOUKU_MOVIE:
                break;
        }

    }
}
